package com.ccf.business.etl.model;

import cn.hutool.core.bean.BeanUtil;
import com.ccf.business.etl.model.vo.JobVO;
import com.service.mybatis.pojo.SuperEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.apache.commons.beanutils.BeanUtilsBean;

import java.util.Date;

/**
 * 任务运行实例表
 *
 * @author zhaoj
 * @date 2021-12-01 15:15:53
 */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
@NoArgsConstructor
@AllArgsConstructor
@TableName("wj_job")
@ApiModel(value="wj_job对象", description="任务运行实例表")
public class Job extends SuperEntity {
    private static final long serialVersionUID=1L;


    @ApiModelProperty(value = "任务ID")
    private String taskId;

    @ApiModelProperty(value = "流程设计ID")
    private String flowId;

    @ApiModelProperty(value = "开始时间")
    private Date startTime;

    @ApiModelProperty(value = "结束时间")
    private Date endTime;

    @ApiModelProperty(value = "运行状态  running-运行中 finish-已完成  fail-运行失败")
    private String status;

    @ApiModelProperty(value = "运行时长（秒）")
    private Long elapsedTime;

    @ApiModelProperty(value = "日志信息")
    private String logInfo;

    public JobVO toVo(){
        JobVO vo = new JobVO();
        BeanUtil.copyProperties(this, vo);
        return vo;
    }
}
